﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Butterfly.Library.Components.Providers;

namespace MyPay.Library.Providers
{
    public abstract class DataProvider 
    {
        private static DataProvider objProvider;
        public static DataProvider Instance()
        {
            if (objProvider == null)
            {
                DataAccessProviderConfiguration objConfig = DataAccessProviderConfiguration.GetDataAccessProviderConfiguration();
                Provider defaultProvider = (Provider)objConfig.Providers[objConfig.DefaultProvider];
                Provider provider = new Provider(defaultProvider.ProviderName, "MyPay.Library.Providers." + defaultProvider.ProviderName, defaultProvider.ConnectionString);
                objProvider = (DataProvider)DataAccessProviderFactory.CreateDataAccess(provider);
            }
            return objProvider;
        }

        public abstract string GetAccount(string bankcode);
    }
}
